using System;
using System.Collections.Generic;

namespace SeataNet.Core.Saga
{
    /// <summary>
    /// Saga事务开始结果
    /// </summary>
    public class TransactionBeginResult
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 事务XID
        /// </summary>
        public string Xid { get; set; } = string.Empty;

        /// <summary>
        /// 事务ID
        /// </summary>
        public long TransactionId { get; set; }

        /// <summary>
        /// 错误消息
        /// </summary>
        public string Message { get; set; } = string.Empty;
    }

    /// <summary>
    /// Saga事务提交结果
    /// </summary>
    public class TransactionCommitResult
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 错误消息
        /// </summary>
        public string Message { get; set; } = string.Empty;
    }

    /// <summary>
    /// Saga事务回滚结果
    /// </summary>
    public class TransactionRollbackResult
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 错误消息
        /// </summary>
        public string Message { get; set; } = string.Empty;
    }

    /// <summary>
    /// Saga步骤注册结果
    /// </summary>
    public class SagaStepRegisterResult
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 步骤ID
        /// </summary>
        public string StepId { get; set; } = string.Empty;

        /// <summary>
        /// 错误消息
        /// </summary>
        public string Message { get; set; } = string.Empty;
    }

    /// <summary>
    /// Saga步骤状态报告结果
    /// </summary>
    public class SagaStepReportResult
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 错误消息
        /// </summary>
        public string Message { get; set; } = string.Empty;
    }
}